localData = { // 跨平台的本地存储类
	hname : 'axylocalStatus',
	// ty4 hname:location.hostname?location.hostname:'localStatus',
	isLocalStorage : window.localStorage ? true : false,
	dataDom : null,

	initDom : function() { // ty3 初始化userData
		if (!this.dataDom) {
			try {
				this.dataDom = document.createElement('input');// ty3
																// 这里使用hidden的input元素
				this.dataDom.type = 'hidden';
				this.dataDom.style.display = "none";
				this.dataDom.addBehavior('#default#userData');// ty3
																// 这是userData的语法
				document.body.appendChild(this.dataDom);
				var exDate = new Date();
				exDate.setDate(exDate.getDate() + 30);
				this.dataDom.expires = exDate.toUTCString();// ty3 设定过期时间
			} catch (ex) {
				return false;
			}
		}
		return true;
	},
	setItem : function(key, value) {
		if (this.isLocalStorage) {
			window.localStorage.setItem(key, value);
		} else {
			if (this.initDom()) {
				this.dataDom.load(this.hname);
				this.dataDom.setAttribute(key, value);
				this.dataDom.save(this.hname)
			}
		}
	},
	getItem : function(key) {
		if (this.isLocalStorage) {
			return window.localStorage.getItem(key);
		} else {
			if (this.initDom()) {
				this.dataDom.load(this.hname);
				return this.dataDom.getAttribute(key);
			}
		}
	},
	remove : function(key) {
		if (this.isLocalStorage) {
			localStorage.removeItem(key);
		} else {
			if (this.initDom()) {
				this.dataDom.load(this.hname);
				this.dataDom.removeAttribute(key);
				this.dataDom.save(this.hname)
			}
		}
	}
}

function MysetItem(key, value) {
	
	var rt = window.external.mxGetRuntime();
	if (typeof (rt) == "undefined"){
		localData.setItem(key, value);
	} else {
		rt.storage.setConfig(key, value);
		
	}
		
}
function MygetItem(key) {
	var rt = window.external.mxGetRuntime();
	if (typeof (rt) == "undefined"){
		return localData.getItem(key);
	} else {
		return rt.storage.getConfig(key);
	}
	return "";
}


		var vv = document.getElementsByName("title");
		if(vv.length==0){
			MysetItem("title",document.title);
		}else{
			MysetItem("title",vv[0].content);
		}
		
		vv = document.getElementsByName("keywords");
		if(vv.length==0){
			MysetItem("tag","");
		}else{
			MysetItem("tag",vv[0].content);
		}
		
		vv = document.getElementsByName("description");
		if(vv.length==0){
			MysetItem("intro","");
		}else{
			MysetItem("intro",vv[0].content);
		}

		if(document.location.href) {
			MysetItem("url",document.location.href);
		}else {
			MysetItem("url","");
		}
		
		var div = document.createElement("div");
		div.setAttribute("onclick", "return window;");
		div.setAttribute("id", "qwertyuas");
		var unsafeWindow = div.onclick();
		if(unsafeWindow.videoId){
			MysetItem("videoid",unsafeWindow.videoId);
		}else {
			MysetItem("videoid","");
		}

		//var sel = window.getSelection().getRangeAt(0);
		//GetChormeInnerHTML(sel.cloneContents().childNodes);